package com.jy.rhin.model.body.jiankangtj;


import com.jy.rhin.infra.cda.EDataElement;
import com.jy.rhin.infra.cda.XPath;
import com.jy.rhin.infra.cda.XValid;
import com.jy.rhin.model.CodeObject;
import com.jy.rhin.model.ValueUnit;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * 用药
 * @author shenguangyang
 */
@Data
public class YongYao {

    //用药条目列表
    @XPath(path = "/entry/.."
            , listItemPath = "/entry/substanceAdministration", listItemBackLevel = 0)
    List<Item> yongYaoItemList = new ArrayList<>();

    @Data
    public static class Item {
        //用药途径
        @XPath(path = "/routeCode"
                , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE06_00_134_00))
        CodeObject yongYaoTJ;
        //单次用药剂量
        @XPath(path = "/doseQuantity"
                , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE08_50_023_00))
        ValueUnit danCiYYJL;

        //药品名称
        @XPath(path = "/consumable/manufacturedProduct/manufacturedLabeledDrug/name/text()"
                , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE08_50_022_00))
        String yaoPinMC;

        //药物使用频率
        @XPath(path = "/rateQuantity"
                , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE06_00_133_00))
        ValueUnit yaoWuSYPL;

        // 药品服从性
        @XPath(path = "/entryRelationship/observation/code[@code='DE06.00.027.00']/../value"
                , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE06_00_027_00))
        CodeObject yaoPinFCX;
    }
}
